Skip to content

fix(fetch-content): check the compressed stream's integrity on Windows - #1074

Merged
jcristau merged 1 commit into
taskcluster:mainfrom
jcristau:fetch-content-windows-gzip-crc
Oct 14, 2026
Merged

jcristau merged 1 commit into
taskcluster:mainfrom
jcristau:fetch-content-windows-gzip-crc

Conversation

@jcristau

@jcristau jcristau commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

When extracting with tarfile, reading stops at the end-of-archive marker, which can leave the end of the compressed stream unread. For gzip, that means its CRC never gets checked, so a corrupted archive whose deflate data still decodes would extract without error. Read the decompressed stream to the end after extracting, like the tar pipe already does.

This made test_stream_extract_broken_archive_not_retried[gz] fail intermittently on Windows.

When extracting with tarfile, reading stops at the end-of-archive marker,
which can leave the end of the compressed stream unread. For gzip, that
means its CRC never gets checked, so a corrupted archive whose deflate
data still decodes would extract without error. Read the decompressed
stream to the end after extracting, like the tar pipe already does.

This made test_stream_extract_broken_archive_not_retried[gz] fail
intermittently on Windows.
@jcristau
jcristau marked this pull request as ready for review October 8, 2026 14:15
@jcristau
jcristau requested a review from a team as a code owner October 8, 2026 14:15
@jcristau
jcristau requested a review from hneiva October 8, 2026 14:15
@jcristau
jcristau merged commit 4470ce9 into taskcluster:main Oct 14, 2026
30 of 31 checks passed
@jcristau
jcristau deleted the fetch-content-windows-gzip-crc branch October 14, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants